#version 330 core
out vec4 FragColor;

in vec2 TexCoords;
in vec3 Normal;
in vec3 Position;

uniform vec3 cameraPos;
uniform sampler2D texture_diffuse1;
uniform samplerCube skybox;

void main()
{
    float ratio = 1.00 / 1.52; //玻璃
    vec3 I = normalize(Position - cameraPos);
//    vec3 R = reflect(I, normalize(Normal));//反射
    vec3 R = refract(I, normalize(Normal), ratio);//折射
    FragColor = vec4(texture(skybox, R).rgb, 1.0);
}
